<?php
	namespace LEA\UserBundle\Utility;
	
	use Symfony\Component\HttpFoundation\Session;
	
	class Utility {
	    function getParam($name, $alt="", $request) {
			$session = $request->getSession();
		
		    /*if (array_key_exists($name, $request()->get()->all())) {
		        //error_log ("param ".$name."-->".$_REQUEST[$name]);
		        return $this->getRequest()->request->get($name);
		    } else{*/			 	
			    if ($session->has($name)) {
		        //error_log ("session ".$name."-->".$_SESSION[$name]);
		        return $session->get($name);
		        } else {
		        	//error_log ("alt $name ".$alt);
		        	return $alt;
		        }   
			    
		   // }
		}
	}
?>